function savealternate() {

	$.post("/req1/newalternate.json", $("#formOne").serialize()).done(
			function(result) {
				alert("success - " + result);
				$.bootstrapGrowl("My message");
			}).fail(function(result) {
		alert("error - " + result);
	});
}


function openModal(mainflowId){
	
	//set id
	alert('mainflowId = ' + mainflowId);
	//open modal
	$('#myModal').modal('show');
}


$(document)
		.ready(
				function() {

					// turn to inline mode
					$.fn.editable.defaults.mode = 'inline';

					$("#formOneBtn").on("click", function(e) {
						e.preventDefault();
						alert('Modal save initialized.');
						savealternate();
					});

					$("#example-paper").tablecloth({
						theme : "paper",
						striped : true
					});
					
					$(".alternate").tablecloth({
						theme : "paper",
						striped : true
					});
					
					$(".condition").tablecloth({
						theme : "paper",
						striped : true
					});
					

					$('.editable a')
							.editable(
									{
										type : 'textarea',
										url : '/req1/updatemainflow.json',
										rows : 4,
										title : 'Edit Description',
										success : function(data, config) {
											var msg = 'New user created! Now editables submit individually.';
											$('#msg').addClass('alert-success')
													.removeClass('alert-error')
													.html(msg).show();
										}
									});

				});